package com.lanyun.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Objects;

public class Emp {
    private Integer eid;//员工id
    private String loginname;//员工登录名称
    private String pwd;//员工登录密码
    private String realname;//员工名字
    private String gender;//员工性别
    private String email;//员工邮箱
    private String phone;//员工电话
    private String address;//员工地址
    @DateTimeFormat(pattern = "yyyy-MM-dd")//入参
    @JsonFormat(pattern = "yyyy-MM-dd")//出参
    private Date birthday;//员工生日
    private Dept dept;


    public Dept getDept() {
        return dept;
    }

    public void setDept(Dept dept) {
        this.dept = dept;
    }

    public Integer getEid() {
        return eid;
    }

    public void setEid(Integer eid) {
        this.eid = eid;
    }

    public String getLoginname() {
        return loginname;
    }

    public void setLoginname(String loginname) {
        this.loginname = loginname;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Emp emp = (Emp) o;
        return Objects.equals(eid, emp.eid) &&
                Objects.equals(loginname, emp.loginname) &&
                Objects.equals(pwd, emp.pwd) &&
                Objects.equals(realname, emp.realname) &&
                Objects.equals(gender, emp.gender) &&
                Objects.equals(email, emp.email) &&
                Objects.equals(phone, emp.phone) &&
                Objects.equals(address, emp.address) &&
                Objects.equals(birthday, emp.birthday) &&
                Objects.equals(dept, emp.dept);
    }

    @Override
    public String toString() {
        return "Emp{" +
                "eid=" + eid +
                ", loginname='" + loginname + '\'' +
                ", pwd='" + pwd + '\'' +
                ", realname='" + realname + '\'' +
                ", gender='" + gender + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", address='" + address + '\'' +
                ", birthday=" + birthday +
                ", dept=" + dept +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(eid, loginname, pwd, realname, gender, email, phone, address, birthday, dept);
    }

    public Emp(Integer eid, String loginname, String pwd, String realname, String gender, String email, String phone, String address, Date birthday, Dept dept) {
        this.eid = eid;
        this.loginname = loginname;
        this.pwd = pwd;
        this.realname = realname;
        this.gender = gender;
        this.email = email;
        this.phone = phone;
        this.address = address;
        this.birthday = birthday;
        this.dept = dept;
    }

    public Emp(){

    }
}